Skip to content

Conversation

@DanielDerefaka
Copy link
Contributor

@DanielDerefaka DanielDerefaka commented Jan 6, 2026

Summary

  • Adds a language dropdown in the status page settings allowing admins to set a specific display language for anonymous visitors
  • When configured, anonymous visitors see the status page in the selected language instead of their browser's default
  • Includes database migration to add language column to status_page table

Fixes #5836

Changes

  • Added database migration 2026-01-06-0000-add-status-page-language.js
  • Modified server/model/status_page.js to include language in JSON output
  • Modified server/socket-handlers/status-page-socket-handler.js to save language setting
  • Added language selector dropdown in src/pages/StatusPage.vue
  • Added translation strings to src/lang/en.json
  • Modified src/mixins/lang.js to support non-persisted language changes
  • Modified src/i18n.js and src/util-frontend.js for status page language support

Test plan

All tests completed successfully:

  • Create a new status page
  • Set language to a non-English language (e.g., Russian)
  • Save the status page
  • Open the public status page in an incognito/private browser window
  • Verify the page displays in the configured language
  • Verify logged-in users still see their preferred language

Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=101010297

DanielDerefaka and others added 2 commits January 6, 2026 18:58
… visitors

Adds a language dropdown in the status page settings that allows admins to set
a specific display language for anonymous visitors. When configured, anonymous
visitors will see the status page in the selected language instead of their
browser's default language.

Fixes louislam#5836

Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=101010297
@DanielDerefaka

This comment was marked as spam.

@CommanderStorm CommanderStorm added the pr:needs review this PR needs a review by maintainers or other community members label Jan 15, 2026
Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don’t ping maintainers unless it’s necessary (e.g. to clarify blocking questions).

I need to set a clear boundary here: repeated or unnecessary pings slow things down rather than speed them up. PRs are reviewed in order as time allows, and excessive nudging disrupts that process.


On the PR:

  • functionality looks good and works
  • but some of the code needs minor cleanup before we can merge

Comment on lines +46 to +47
async changeLang(lang, options = {}) {
const persist = options.persist !== false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use single-item options as it is harder to reason about them when only used once

Suggested change
async changeLang(lang, options = {}) {
const persist = options.persist !== false;
async changeLang(lang, persist = true) {

// Apply configured language if the visitor hasn't set their own preference
if (this.config.language && !localStorage.locale) {
this.$root.setLanguage(this.config.language, { persist: false });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not changeLang?

Comment on lines +670 to +673
if (!("language" in this.config)) {
this.config.language = null;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this happening?

data() {
return {
language: currentLocale(),
persistLanguage: true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is only ever written, what are you trying to do here?

* @returns {void}
*/
export function setPageLocale() {
export function setPageLocale(locale = currentLocale()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is resonably hard to read. Please change it like this instead and adjust the callsites.

This feedback also is applicable to localeDirection

Suggested change
export function setPageLocale(locale = currentLocale()) {
export function setPageLocale(locale) {

Comment on lines +163 to +167
if (typeof config.language === "string" && config.language.trim() !== "") {
statusPage.language = config.language.trim();
} else {
statusPage.language = null;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the equivalent, or?

Suggested change
if (typeof config.language === "string" && config.language.trim() !== "") {
statusPage.language = config.language.trim();
} else {
statusPage.language = null;
}
statusPage.language = config.language?.trim() || null;

Comment on lines +968 to +988
if (!("language" in this.config)) {
this.config.language = null;
}
if (this.config.icon) {
this.imgDataUrl = this.config.icon;
}
// Apply configured language if the visitor hasn't set their own preference
if (this.config.language && !localStorage.locale) {
this.$root.setLanguage(this.config.language, { persist: false });
}
this.incident = res.data.incident;
this.maintenanceList = res.data.maintenanceList;
this.$root.publicGroupList = res.data.publicGroupList;
if (!this.config.domainNameList) {
this.config.domainNameList = [];
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please explain what you added here and why.
This might have been a merge issue with master..

"Leave blank to use status page title": "Leave blank to use status page title",
"Status Page Language": "Status Page Language",
"Use browser language": "Use browser language",
"statusPageLanguageDescription": "Set the display language for anonymous visitors to this status page",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can be more explicit here what this does

Suggested change
"statusPageLanguageDescription": "Set the display language for anonymous visitors to this status page",
"statusPageLanguageDescription": "Set the display language for anonymous visitors to this status page. Logged-in users can change the language they see in their own settings.",

@CommanderStorm CommanderStorm added pr:please address review comments this PR needs a bit more work to be mergable and removed pr:needs review this PR needs a review by maintainers or other community members labels Jan 15, 2026
@CommanderStorm CommanderStorm marked this pull request as draft January 15, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:please address review comments this PR needs a bit more work to be mergable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Language issue – Monitoring page shows "All Systems Operational" instead of Russian

2 participants